<div class="completed-contract-lr-container">
	<select style="margin-bottom: 5px;" class="btn btn-info btn-sm select-year">
		<#assign now = .now?string('yyyy')?number> <#list 0..9 as step>
		<option value="${now-step}" ${((year==now-step)?string('selected',''))!''}>${now-step}&nbsp;年</option>
		</#list>
	</select>
	<div class="btn btn-danger btn-sm export-of-year" style="margin-top: -4px;">
		<i class="icon-signout"></i>
		导出
	</div>

	<table class="completed-contract-lr" style="min-width: 2000px;">
		<tr class="title-row">
			<th class="text-center" width="45">序号</th>
			<th class="text-center">项目编码</th>
			<th class="text-center">合同名称</th>
			<th class="text-center" width="100">实际工期</th>
			<th class="text-center">建设单位</th>
			<th class="text-center" width="73">完工情况</th>
			<th class="text-center">合同金额（元）</th>
			<th class="text-center">
				结算价
				<br>
				金额（元）
			</th>
			<th class="text-center">
				任务书
				<br>
				金额（元）
			</th>
			<th class="text-center">
				分包
				<br>
				金额（元）
			</th>
			<th class="text-center">
				材料费
				<br>
				金额（元）
			</th>
			<th class="text-center">
				其他费用
				<br>
				金额（元）
			</th>
			<th class="text-center">毛利（元）</th>
			<th class="text-center" width="125">毛利占结算金额的百分比</th>
			<th class="text-center" width="70">项目负责人</th>
			<th class="text-center">实施单位</th>
			<th class="text-center">备注</th>
		</tr>
		<#if data??> <#list data as d>
		<tr>
			<td class="text-center">${d_index+1}</td>
			<td class="text-center">${d.no}</td>
			<td class="text-center">${d.name}</td>
			<td class="text-center">${d.gongQi}</td>
			<td class="text-center">${d.companyA}</td>
			<td class="text-center">${d.completed}</td>
			<td class="text-center">${(d.price?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.jsPrice?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.taskPrice?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.subPrice?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.materialPrice?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.otherPrice?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.lr?string('#,##0.00'))!'-'}</td>
			<td class="text-center">${(d.lrRatio?string('#,##0.00%'))!'-'}</td>
			<td class="text-center">${d.header}</td>
			<td class="text-center">${d.companyB}</td>
			<td class="text-center">${d.remark}</td>
		</tr>
		</#list> <#else>
		<tr>
			<td colspan="17">暂无数据</td>
		</tr>
		</#if>
	</table>
</div>

<script src="${request.contextPath}/js/suredy-list.js"></script>
<script src="${request.contextPath}/core/js/jquery.form.js"></script>
<script type="text/javascript">
	$(function() {
		$('table.completed-contract-lr').list({
			header : false,
			footer : false,
		});

		$('select.select-year').on('change', function() {
			var $this = $(this);

			$.suredy.loadContent('${request.contextPath}/completed-contract-lr?year=' + $this.val());
		});

		$('div.btn.export-of-year').on('click', function() {
			var year = $('select.select-year').val();

			window.open('${request.contextPath}/completed-contract-lr/export?year=' + year, '_blank');
		});
	});
</script>